<template>
  <div class="details" v-loading="loading">
    <div class="header">
      <div class="list" v-for="(item, index) in 5" :key="index">
        <div class="title">
          {{
            index == 0
              ? "用户头像"
              : index == 1
                ? "用户昵称"
                : index == 2
                  ? "用户手机号"
                  : index == 3
                    ? "反馈时间"
                    : index == 4
                      ? "状态"
                      : ""
          }}：
        </div>

        <div class="img" v-if="index == 0">
          <img :src="commonObj.avatar" alt="" />
        </div>

        <div class="text text-line" v-else>
          {{
            index == 1
              ? commonObj.nickname
              : index == 2
                ? commonObj.phone
                : index == 3
                  ? commonObj.createTime
                  : index == 4
                    ? commonObj.status == 0
                      ? "未处理"
                      : commonObj.status == 1
                        ? "已处理"
                        : ""
                    : ""
          }}
        </div>
      </div>
    </div>

    <div class="matter">
      <div class="title">反馈内容：</div>
      <div class="text">
        {{ commonObj.feedbackContent }}
      </div>
    </div>

    <div class="matter">
      <div class="title">反馈图片：</div>
      <div class="parallel">
        <div class="imgs" v-for="(item, index) in bannerList" :key="index">
          <el-image :src="item" :preview-src-list="srcList0"></el-image>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { restFeedbackListId } from "@/api/rest";
export default {
  data() {
    return {
      id: "",
      loading: false,
      commonObj: {},
      bannerList: [],
      srcList0: [],
    };
  },
  created() {
    this.loading = true;
    this.id = this.$route.query.id;
    this.restFeedbackListIdMet();
  },
  methods: {
    restFeedbackListIdMet() {
      let params = this.id;

      restFeedbackListId(params).then((res) => {
        if (res.errorCode == null) {
          this.commonObj = res.resultData;
          if (res.resultData.proveImageList != null) {
            this.bannerList = res.resultData.proveImageList.split(";");
            this.srcList0 = res.resultData.proveImageList.split(";");

          }
          this.loading = false;
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
.details {
  .header {
    display: flex;

    .list {
      width: calc(80% / 5);
      display: flex;
      align-items: center;
      height: 70px;
      color: rgba(0, 0, 0, 0.6);

      .title {
        color: rgba(0, 0, 0, 0.7);
      }

      .text {
        color: rgba(0, 0, 0, 0.7);
        width: 60%;
      }

      .img {
        width: 50px;
        height: 50px;

        img {
          width: 100%;
          height: 100%;
          border-radius: 50%;
        }
      }
    }
  }

  .matter {
    margin-top: 40px;
    display: flex;

    .title {
      color: rgba(0, 0, 0, 0.7);
    }


    .text {
      width: 350px;
      border: 1px solid #ccc;
      height: 200px;
      padding: 10px;
      box-sizing: border-box;
      border-radius: 5px;
      color: rgba(0, 0, 0, 0.7);
            word-break: break-all;
    }

    .parallel {
      display: flex;

      .imgs {
        width: 120px;
        height: 120px;
        border-radius: 5px;
        margin-right: 20px;

        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}
</style>